

<%@page contentType="text/html" pageEncoding="UTF-8" errorPage="error.jsp"%>
<%@taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script language="javascript">

    function checkInputData()
    {
        if(document.frmRegister.userName.value == ""){
            alert("You must input Email!");
            document.frmRegister.userName.focus();
            return false;
        }
        if(document.frmRegister.password.value == ""){
            alert("You must input password!");
            document.frmRegister.password.focus();
            return false;
        }
        if(document.frmRegister.userEmail.value == ""){
            alert("You must input Email!");
            document.frmRegister.userEmail.focus();
            return false;
        }
        if(document.frmRegister.userPassword.value == ""){
            alert("You must input Password!");
            document.frmRegister.userPassword.focus();
            return false;
        }
        if(document.frmRegister.repassword.value == ""){
            alert("You must input RePassword!");
            document.frmRegister.repassword.focus();
            return false;
        }
        if(document.frmRegister.repassword.value != document.frmRegister.userPassword.value){
            alert("RePassword must be same as Password");
            document.frmRegister.repassword.focus();
            return false;
        }
        if(document.frmRegister.userAddress.value == ""){
            alert("You must input Address!");
            document.frmRegister.userAddress.focus();
            return false;
        }
        if(document.frmRegister.userPhone.value == ""){
            alert("You must input Phone!");
            document.frmRegister.userPhone.focus();
            return false;
        }
        return true;
    }
    function checkInputDataLogin()
    {
        if(document.login.email.value == ""){
            alert("You must input Email!");
            document.login.email.focus();
            return false;
        }
        if(document.login.password.value == ""){
            alert("You must input Password!");
            document.login.password.focus();
            return false;
        }
        return true;
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>My Sweet Home Websites </title>
        <meta name="keywords" content="my sweet home, real estate website, website my home, msh, CSS, XHTML" />
        <meta name="description" content="Real Estate , website eproject of Aptech" />
        <link href="CSS/msh_style.css" rel="stylesheet" type="text/css" />
        <link rel="stylesheet" type="text/css" href="CSS/gallery_style.css" />
    </head>
    <%
                com.aptech.model.User oBjUser = new com.aptech.model.User();
                if (session.getAttribute("objUser") != null) {
                    response.sendRedirect("reportRegister.jsp");
                } else {
    %>
    <body>
        <div id="msh_container">
            <div id="msh_top_panel">
                <div id="msh_header_section">
                    <div id="msh_header">

                    </div>
                </div> <!-- end of header section -->

                <div id="msh_menu_login_section">
                    <div id="msh_menu_section">
                        <div id="msh_menu_panel">
                            <ul>
                                <li><a href="home.jsp" class="current">Home</a></li>
                                <li><a href="faq.jsp">FAQs</a></li>
                                <li><a href="register.jsp">Register</a></li>
                                <li><a href="#">About</a></li>
                                <li><a href="#">Contact</a></li>
                            </ul>
                        </div> <!-- end of menu -->
                    </div>
                </div> <!-- end of menu login section -->
            </div> <!-- end of top panel -->

            <div id="msh_gallery_panel">
                <div id="gallery">
                    <div id="imagearea">
                        <div id="image">
                            <a href="javascript:slideShow.nav(-1)" class="imgnav " id="previmg"></a>
                            <a href="javascript:slideShow.nav(1)" class="imgnav " id="nextimg"></a>
                        </div>
                    </div>
                    <div id="thumbwrapper">
                        <div id="thumbarea">
                            <ul id="thumbs">
                                <li value="1"><img src="images/thumbs/1.jpg" width="179" height="100" alt="" /></li>
                                <li value="2"><img src="images/thumbs/2.jpg" width="179" height="100" alt="" /></li>
                                <li value="3"><img src="images/thumbs/3.jpg" width="179" height="100" alt="" /></li>
                                <li value="4"><img src="images/thumbs/4.jpg" width="179" height="100" alt="" /></li>
                                <li value="5"><img src="images/thumbs/5.jpg" width="179" height="100" alt="" /></li>
                                <li value="3"><img src="images/thumbs/3.jpg" width="179" height="100" alt="" /></li>
                                <li value="4"><img src="images/thumbs/4.jpg" width="179" height="100" alt="" /></li>
                                <li value="5"><img src="images/thumbs/5.jpg" width="179" height="100" alt="" /></li>
                            </ul>
                        </div>
                    </div>
                </div>

                <script type="text/javascript">
                        var imgid = 'image';
                        var imgdir = 'images/fullsize';
                        var imgext = '.jpg';
                        var thumbid = 'thumbs';
                        var auto = true;
                        var autodelay = 5;
                </script>
                <script type="text/javascript" src="JS/slide.js"></script>

            </div>

            <div id="msh_content_panel_register">

                <div id="msh_news_section_register">
                    <h1>Account Register</h1>
                    <div class="msh_news_box">

                        <form action="addUser.do" method="post" name="frmRegister" class="frmRegister" id="frmRegister" onsubmit="return checkInputData()">
                            <%
                                                com.aptech.model.User objUser = new com.aptech.model.User();
                                                if (session.getAttribute("reg_fail") != null) {
                                                    session.setAttribute("reg_fail", null);
                            %>
                            <table width="30%" height=30" align="center">
                                <tr>
                                    <td align="center"><h3><p align="center" style="color:#FF0000" > Please, Enter All Records !!!</p></h3></td>
                                </tr>
                            </table>
                            <%
                                                }
                            %>
                            <table align="center" border="0.5px">
                                <tr>
                                    <td><label > Full Name :  </label> </td> <td><input type="text" name="userName" class="input_field" id="userName" /> </td>
                                    <td><label > Email Address : </label> </td> <td><input type="text" name="userEmail" class="input_field" id="userEmail" /> </td>
                                </tr>
                                <tr>
                                    <td><label> Password : </label> </td> <td><input type="password" name="userPassword" class="input_field" id="userPassword"/> </td>
                                    <td><label> Re-Password : </label> </td> <td><input type="password" name="RePassword" class="input_field" id="rePassword" /> </td>
                                </tr>
                                <tr>
                                    <td><label> User Type : </label> </td>
                                    <td> <select name="userTypeID" >
                                            <option>Choose... </option>
                                            <option value="1">Guest</option>
                                            <option value="2">Seller</option>
                                            <option value="3">Buyer</option>
                                        </select>
                                    </td>
                                    <td><label> Phone : </label> </td> <td><input type="text" name="userPhone" class="input_field" id="userPhone"/> </td>
                                </tr>
                                <tr>
                                    <td> <label> Address :  </label> </td> <td><textarea name="userAddress" rows="5" class="area_field" id="userAddress" > </textarea> </td>
                                </tr>
                                <tr>
                                    <td> </td> <td> <input type="submit" value="Submit" name="btnRegister" class="" alt="Register" /> &nbsp;
                                        <input type="reset" value="Reset " name="btnReset" class="" alt="Clear all Form" /> </td> <td> </td> <td> </td>
                                </tr>
                            </table>
                        </form>
                    </div>
                </div><!-- end of news section -->
                <div class="cleaner_with_height">&nbsp;</div>
                <div class="cleaner_with_height">&nbsp;</div>
            </div>
            <div class="cleaner_with_height">&nbsp;</div>
            <div id="msh_footer_panel">
                Copyright © 2011 <a href="aptech.vn">Ha Noi - Aptech</a> | <a href="home.jsp" target="_parent">Website My Sweet Home</a> by <a href="home.jsp" target="_blank">Group 106</a></div>
        </div> <!-- end of container -->
    </body>
    <% }%>
</html>
